//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.aidong.dao.wills;

import com.aidong.dao.wills.BaseDao;
import com.aidong.model.wills.DicSalesCode;
import org.springframework.stereotype.Repository;

@Repository
public class DicSalesCodeDao extends BaseDao<DicSalesCode, String> {
	public DicSalesCodeDao() {
	}

	public DicSalesCode getById(String code) {
		return this.getByCode(code);
	}

	public DicSalesCode getByCode(String code) {
		return (DicSalesCode)this.getByWhere("code=:p1", new Object[]{code});
	}

	public DicSalesCode getByName(String name) {
		return (DicSalesCode)this.getByWhere("chName=:p1", new Object[]{name});
	}

	public boolean updateStatus(String code, int status) {
		String hql = "update DicSalesCode set status=:p1 where code=:p2";
		return this.updateByHql(hql, new Object[]{Integer.valueOf(status), code}) > 0;
	}
}
